#! /usr/bin/env python
# -*- coding: utf-8 -*-
from jinja2 import Environment,FileSystemLoader

def render_template(template_name, **context):
	extensions = context.pop('extensions', [])
	globals = context.pop('globals', {})

	jinja_env = Environment(
			loader=FileSystemLoader('templates'),
			extensions=extensions,
			)
	jinja_env.globals.update(globals)

	return jinja_env.get_template(template_name).render(context)